<script setup lang="ts">
const props = defineProps<{
  reverseDirection: boolean,
  isNew: string,
  screenSize: string,
  goodName: string,
  goodSignature: string,
  imgSrc: string
}>()
</script>

<template>
  <div class="macbriefcontainer _macbriefcontainer">
    <div :class="{ reverse: reverseDirection }">
      <div>
        <div>
          <h3>{{ props.isNew === 'yes' ? '新款' : '' }}</h3>
          <span>{{ screenSize }}</span>
          <h1>{{ goodName }}</h1>
          <h2>{{ goodSignature }}</h2>
          <p>进一步了解</p>
        </div>
      </div>
      <div>
        <img :src="imgSrc" alt="">
      </div>
    </div>
  </div>
</template>

<style scoped lang="less">
.reverse {
  flex-direction: row-reverse;
}


@media only screen and (min-width: 800px) {
  .macbriefcontainer {
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 60px 0;

    div {
      max-width: 1000px;
      display: flex;
      width: 100%;
      justify-content: space-around;
      align-items: center;

      div:nth-child(1) {
        width: 45%;
        text-align: left;

        div {
          display: flex;
          flex-direction: column;
          align-items: flex-start;
          line-height: 1.5;

          h3 {
            color: rgb(234, 94, 0);
          }

          p {
            color: rgb(12, 106, 205);
            transition: all .4s;
            cursor: pointer;

            &:hover {
              transform: translateX(3px);
            }
          }
        }
      }

      div:nth-child(2) {
        display: flex;
        align-items: center;
        width: 55%;

        img {
          width: 100%;
          height: auto;
          object-fit: cover;
        }

      }

    }

  }
}

// 小于800px
@media only screen and (max-width: 799px) {
  .macbriefcontainer {
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 60px 0;

    div {
      display: flex;
      flex-direction: column !important;
      width: 100%;
      align-items: center;

      div:nth-child(1) {
        width: 50%;
        text-align: left;

        div {
          display: flex;
          flex-direction: column;
          align-items: flex-start;
          line-height: 1.5;

          h3 {
            color: rgb(234, 94, 0);
          }

          p {
            color: rgb(12, 106, 205);
            transition: all .4s;
            cursor: pointer;

            &:hover {
              transform: translateX(3px);
            }
          }
        }
      }

      div:nth-child(2) {
        display: flex;
        align-items: center;
        width: 70%;

        img {
          width: 100%;
          height: auto;
          padding: 20px 0;
        }

      }

    }

  }
}
</style>
